{include file="header.html"}
{*日志部分*}
<div id="content">
<div class="pl">
<script type="text/javascript">
var name_notice='用户名不能为空';
var password_notice='密码不能为空';
var re_password_notice='两次密码不一致';
var email_notice='E-MAIL不能为空';
<!-- {literal} -->
var result=$('input').val();
$(document).ready(function()
{
   $('input').blur(function(){
     
   		if(this.id == 'name'){
			if(this.value==''){
				$('#name_notice').html(name_notice);
			}
			else{
				$('#name_notice').html('');
				p='name='+this.value;
     			$.ajax({url:'user.php?act=check_name',type:'post', dataType:'json',data:p,success:check_name_back});
			}
		}
		
		else if (this.id == 'password'){
			if(this.value==''){
				$('#pass_notice').html(password_notice);
			}
			else{
				$('#pass_notice').html('');
			}
		}
		
		else if (this.id == 're_password'){
			if(this.value!=$('#password').val()){
				$('#re_pass_notice').html(re_password_notice);
			}
			else{
				$('#re_pass_notice').html('');
			}
		}
		
		else if (this.id == 'email'){
			if(this.value==''){
				$('#email_notice').html(email_notice);
			}
			else{
				$('#email_notice').html('');
				p='email='+this.value;
				$.ajax({url:'user.php?act=check_email',type:'post', dataType:'json',data:p,success:check_email_back});
			}
		}
		
	});
});

function check_name_back(data)
{
	if(data.error==1)
	{
		$('#name_notice').html('该用户名已经被注册');
	}
	else
	{
		$('#name_notice').html('该用户名可以使用');
	}
}

function check_email_back(data)
{
	if(data.error==1)
	{
		$('#email_notice').html('该E-MAIL已经被使用了');
	}
	else if (data.error==2)
	{
		$('#email_notice').html('请输入正确的E-MAIL');
	}
	else {
		$('#email_notice').html('E-MAIL正确');
	}
}

<!-- {/literal} -->
</script>

{if $is_reg eq 1}
<div id="notice">系统关闭新用户注册</div>
{else}

<form action="user.php?act=act_reg" method="post"  name="user_reg" id="user_reg">
{if $notice != ''}
<div id="notice">{$notice}</div>
{/if}

 <p>用户名：<br />
  <input name="name" type="text" id="name"  /> <span id="name_notice"></span>
   </p>
   <p>
 密码：<br />
    <input type="password" name="password" id="password" /> <span id="pass_notice"></span>
  </p>
     <p>
 密码确认：<br />
    <input type="password" name="re_password" id="re_password" /> <span id="re_pass_notice"></span>
  </p>
   <p>
 EMAIL：<br />
    <input name="email" type="text" id="email" size="50" /> <span id="email_notice"></span>
  </p>
  <p>
 个人主页地址：<br />
    <input name="home" type="text" id="home" size="50" />
  </p>

  <p>
    <input type="submit" name="button" id="button" value="注册" />
  </p>
</form>

{/if}
</div>



{include file="page.html"}

{include file="footer.html"}